package com.htl.集合;

import java.util.HashSet;
import java.util.Iterator;

public class HashSet__test {
    public static void main(String[] args) {
        HashSet hashSet = new HashSet();
        hashSet.add("Hello");
        hashSet.add("World");
        hashSet.add("Java");
        hashSet.add("Hello");
        System.out.println(hashSet.size());
        System.out.println(hashSet);
        System.out.println("===========================================");
        Iterator iterator = hashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println("===========================================");
        hashSet.remove("Hello");
        System.out.println(hashSet);
    }
}
